package xyz.zhzby.cyzx.oss.util;

import io.swagger.annotations.ApiModel;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author zby
 * @date 2021/12/15
 */
@Component
@ApiModel("当项目已启动，spring接口，spring加载之后，执行接口一个方法")
public class ConstantYamlUtils implements InitializingBean {

    @Value("${cyzx.oss.endpoint}")
    private String endpoint;

    @Value("${cyzx.oss.accessKeyId}")
    private String accessKeyId;

    @Value("${cyzx.oss.accessKeySecret}")
    private String accessKeySecret;

    @Value("${cyzx.oss.bucketName}")
    private String bucketName;


    public static String END_POIND;

    public static String ACCESS_KEY_ID;

    public static String ACCESS_KEY_SECRET;

    public static String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() {
        END_POIND = endpoint;
        ACCESS_KEY_ID = accessKeyId;
        ACCESS_KEY_SECRET = accessKeySecret;
        BUCKET_NAME = bucketName;
    }
}
